<?php
/*
	Copyright 2006-2007  Alex Djachenko
	Authors: Alex Djachenko
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Принять участие в разработке или скачать новую версию вы можете на сайте
    http://code.google.com/p/my-site-framework/
*/

/**
 * Зарегистрировать новый класс дополнительной информации
 */
function addressbook_add_addf($code,$mod,$class,$cfg=null)
{
    $Processor = mst_getdatemod('addressbook','Processor');
    return $Processor->addAddf($code,$mod,$class,$cfg);   
}

function addressbook_get_fperson($id)
{
    $Processor = mst_getdatemod('addressbook','Processor');
    return $Processor->getPerson($id); 
}
function addressbook_save_fperson($obj)
{
    $Processor = mst_getdatemod('addressbook','Processor');
    return $Processor->savePerson($obj); 
}
function addressbook_getobj_fperson()
{
    $Processor = mst_getdatemod('addressbook','Processor');
    return $Processor->query('sc_getObj_fpersones');
}
function addressbook_save_pgroup($name,$parent=null)
{
    $Processor = mst_getdatemod('addressbook','Processor');
    $obj = $Processor->sc_getObj_pgroups();
    $obj->setP($name,'name');
    if ($parent)
    {
        $obj->setP($parent,'parent');
    }
    return $Processor->query('sc_getObj_fpersones');
}
?>